package com.yang.core;

import java.util.ArrayList;
import java.util.HashMap;

public class TestResultsSet {
    //    private ArrayList<TestResult> testResults;
    private HashMap<String, TestResult> testResults = new HashMap<String, TestResult>();
    private ArrayList<String> labels = new ArrayList<String>();


    public boolean isExist(String label) {
        return this.labels.contains(label);
    }

    public void addLabels(String label) {
        this.labels.add(label);
    }

    public void addTestResults(String key, HttpSample httpSample) {
        if (testResults.containsKey(key)) {
            testResults.get(key).update(httpSample);
        } else {
            testResults.put(key, new TestResult());
            addLabels(key);
            testResults.get(key).update(httpSample);
        }


    }

    public ArrayList<String> getLabels() {
        return labels;
    }

    public void setLabels(ArrayList<String> labels) {
        this.labels = labels;
    }

    public HashMap<String, TestResult> getTestResults() {
        return testResults;
    }

    public void setTestResults(HashMap<String, TestResult> testResults) {
        this.testResults = testResults;
    }
}
